#pragma once

#include "Includes.h"

#include "Thread.h"
#include "BufferedReader.h"
#include "IConnection.h"
#include "Exception.h"


class ConnectionBridge 
{
public:
	ConnectionBridge(IConnection& con1, IConnection& con2);
	void start();

private:
	struct _bridge : public Thread
	{
		_bridge(IConnection& from, IConnection& to);

		bool _doRun;
		
		void run() override;

		IConnection& _from;
		IConnection& _to;
	}_bt2s, _s2bt;
};
